const express = require('express');
const bodyParser = require('body-parser');
const productRoutes = require('./routes/productRoutes');

const app = express();
const port = 3000;

// 解析 JSON 请求体
app.use(bodyParser.json());

// 使用商品路由
app.use('/products', productRoutes);

// 启动服务器
app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});